"""
列表合并排序
"""

def combin(list1,list2,gt = lambda x,y:x<=y):
    lista = list1[:]
    listb = list2[:]
    new_list = []
    for i in range(len(lista)):
        for j in range(len(listb)) :
            if gt(list1[i],list2[j]):
                new_list.append(list1[i])
                lista.remove(list1[i])
                break
            else:
                

                new_list.append(list2[j])
                listb.remove(list2[j]) 
    return new_list


def main():
    list1 = [34,44,55,67,89]
    list2 = [12,67,79,89]
    print(combin(list1,list2))


if __name__=='__main__': 
    main()

